<template>
  <div class="content">
    <div class="content-main">
      <div class="left-content">
        <span class="content-title">{{ detailsData.caseName }}</span>
        <span class="type-btn" @click="back">返回列表</span>
      </div>
      <div class="left-content-info" v-html="detailsData.caseContent"></div>
    </div>
  </div>
</template>
<script setup>
import { cmsClassicCaseDetail } from '@/api'
const router = useRouter()
function back() {
  router.go(-1)
}
const detailsData = ref({})
const route = useRoute()
function getDetail() {
  cmsClassicCaseDetail({
    id: route.query.id
  }).then(({data}) => {
    detailsData.value = data
  })
}
onMounted(() => {
  getDetail()
})
</script>
<style lang="scss" scoped>
.content {
  background-color: #f6faff;
  padding-top: 20px;
  padding-bottom: 20px;
}

.content-main {
  width: 1200px;
  margin: auto;
  background-color: #fff;

  .left-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;

    .content-title {
      font-size: 20px;
      font-weight: 600;
      color: #333333;
    }

    .type-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 78px;
      height: 28px;
      background: #e4efff;
      font-size: 14px;
      border-radius: 50px;
      color: #333333;
      cursor: pointer;
    }
  }

  .left-content-info {
    width: auto;
    height: 800px;
    padding: 20px;
    overflow: auto;
    background-color: #fff;
  }
}
</style>
